document.addEventListener('DOMContentLoaded', function() {
    const videoContainers = document.querySelectorAll('.video-container');
    
    videoContainers.forEach(container => {
        const video = container.querySelector('.content-video');
        const overlay = container.querySelector('.play-overlay');
        
        container.addEventListener('click', function() {
            if (video.paused) {
                // 暂停所有其他视频
                document.querySelectorAll('.content-video').forEach(v => {
                    if (v !== video) {
                        v.pause();
                        v.parentElement.querySelector('.play-overlay').classList.remove('hidden');
                    }
                });
                
                // 播放当前视频
                video.play();
                overlay.classList.add('hidden');
            } else {
                // 暂停当前视频
                video.pause();
                overlay.classList.remove('hidden');
            }
        });
        
        // 视频播放结束时显示播放按钮
        video.addEventListener('ended', function() {
            overlay.classList.remove('hidden');
        });
    });
}); 